<?php

namespace App\Http\Controllers\Admin;

use App\Http\Requests\AdminPost;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;

class MyController extends CommonController
{
//    修改密码界面
    public function passwordFrom(){
        return view('admin.my.password');
    }

    //    修改密码方法
    public function changePassword(Request $request,AdminPost $adminPost){
        $model=\Auth::guard('admin')->user();
        $model->password=bcrypt($adminPost->password);
        $model->save();
        flash('用户密码修改成功')->overlay();
        return redirect('/admin/index');
    }
}
